#ifndef TABMANAGER_H
#define TABMANAGER_H
#include "mainwindow.h"
#include "codebuilding.h"
#include "backforward.h"
#include "texteditor.h"
#include <QMainWindow>
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
#include <QTime>
#include <QTextStream>
#include <QDebug>
#include <qtextcodec.h>
#include <QList>
#include <QTextEdit>
#include <codeeditor.h>
#include "syntaxhighlighter.h"
#include "tools.h"

class MainWindow;

class TextEditor;

class CodeBuilding;

class BackForward;

class SyntaxHighlighter;

class TabManager  : public QMainWindow
{
    Q_OBJECT
public:
    TabManager(MainWindow* );
    ~TabManager();
    MainWindow* mainWindow = nullptr;
    TextEditor* textEditor = nullptr;
    CodeBuilding* codeBuilding = nullptr;
    BackForward* backForward = nullptr;
    SyntaxHighlighter* syntaxHighlighter = nullptr;
    CodeEditor *text1 = nullptr;
    QString filename = "";
    QList<QList<QString>> back_text;
    int tab_index = -1;
    /**** tools分支新增 ****/
    ToolsSettings *toolsSettings = nullptr;
    CompilerOptions *compilerOption = nullptr;
    CodeEditor *codeEditor = nullptr;
    /*********************/

public slots:
    void on_tab_changed(int index);
    void on_close_tab(int index);
    void on_newfile();
    void on_open();
    void on_exit();
    bool on_save();
    bool on_save_as();  // 返回是否保存成功
    void on_text_changed_file();
    void onOpenDoc();

    /**** tools分支新增 ****/
    void on_toolsSettingAccepted();
    /*********************/
};

#endif // TABMANAGER_H
